<?php
# RASS unittest runner.
# Copyright (C) 2008 rambla.be
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# credentials and other data dependant of Svr location
# --------------------------------------------------
# !!!!!!!!!!!!!!! EDIT THESE BEFORE RUNNING TESTS !!!!!!!!!!!!
define('SUPERUSER', 'xxx');
define('SUPERPWD', 'xxx');
define('BASE', 'http://rass.cdn01.rambla.be/');
define('NORMAL_USER', 'xxx');
define('NORMAL_PWD', 'xxx');
define('HIDDEN_FILE', '.xxx');
define('USER', '');
define('PWD', '');
define('EMAIL', '');
# local resources
define('LOCAL_FILE', '../test_resources/bla.mp4');

# testdata (independant of Svr location)
# --------------------------------------
define('DIRNAME', 'chiquita');
define('ITEMNAME', 'banana.mp4');
define('MIMETYPE', 'video/quicktime');


if (! defined('SIMPLE_TEST')) {
    define('SIMPLE_TEST', 'simpletest/');
}
require_once(SIMPLE_TEST . 'unit_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');

require_once '../RawsClient/Raws.php';
require_once '../RawsClient/Raws/Rass.php';
require_once '../RawsClient/Raws/Rass/DirQuery.php';

$test = &new GroupTest('All tests');

if (! defined('UNIT_TESTS')) {
    define('UNIT_TESTS', 'unittest/rass_unittests/');
}
require_once(UNIT_TESTS . 'rass_auth_test.php');
$test->addTestCase(new RassAuthTest());
require_once(UNIT_TESTS . 'rass_user_mgmt_test.php');
$test->addTestCase(new RassUserMgmtTest());
require_once(UNIT_TESTS . 'rass_dir_mgmt_test.php');
$test->addTestCase(new RassDirMgmtTest());
require_once(UNIT_TESTS . 'rass_item_mgmt_test.php');
$test->addTestCase(new RassItemMgmtTest());
require_once(UNIT_TESTS . 'rass_feed_test.php');
$test->addTestCase(new RassFeedTest());
require_once(UNIT_TESTS . 'rass_invalid_access_test.php');
$test->addTestCase(new RassInvalidAccessTest());
require_once(UNIT_TESTS . 'rass_https_test.php');
$test->addTestCase(new RassHttpsTest());

$test->run(new HtmlReporter());
